<template lang="html">
  <div class="new-sign-item">
    <div class="sign-info-head">
      <div class="sign-campsu-wrapper">
        <i class="sign-loc-ico"></i>
        <h3 class="sign-campus">{{ value.team_name }}</h3>
      </div>
      <div class="sign-date">{{ value.insert_time }}</div>
    </div>
    <div class="sign-info-body">
      <div class="sign-bd-item">
        <div class="bd-item-head">
          <label>买家信息: </label>
          <span>{{ value.patriarch_name }}</span>
        </div>
        <div class="bd-item-body" v-for="(babyCourse, index) in value.course_list">
          <div class="bd-it-lf">{{ babyCourse.baby_name }}</div>
          <div class="bd-it-rt">
            <template v-for="(course, index) in babyCourse.list">
              <div class="it-rt-kb" v-if="course.course_name">{{ course.course_name }}（{{course.buy_count}}）</div>
              <div class="it-rt-kb" v-if="course.present_course_name">{{ course.present_course_name }}（{{course.present_buy_count }}）(赠送)</div>
            </template>

          </div>
        </div>
      </div>
      <div class="bd-item-od">
        <p><label>订单号：</label>{{ value.order_sn }}</p>
        <p><label>合同号：</label>{{ value.contract_number }}</p>
        <p><label>订单金额：</label>{{ value.contract_money | moneyFormate }}元</p>
        <p><label>付款时间：</label>{{ value.pay_time }}</p>
      </div>
    </div>
    <div class="sign-info-bottom">
      <div v-for="(counselor, index) in value.counselor_list"
      :key="index"
      class="sign-usr">
        <div class="sign-usr-lf">
          <div class="sign-usr-name">{{ counselor.name }}</div>
          <div class="sign-usr-role">({{ getRole(counselor.is_waiter) }}）</div>
        </div>
        <div class="sign-usr-rt">
          <div class="sign-usr-mon">{{ counselor.sum | moneyFormate}}元</div>
          <div class="sign-usr-perc">（{{ counselor.proportion || 0 }}%）</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    value: {
      type: Object
    }
  },
  methods: {
    getRole (isWaiter) {
      return isWaiter === 'true' || isWaiter === true ? '服务方' : '成交方'
    }
  }
}
</script>

<style lang="less">
  .new-sign-item {
    border-top: 1px solid #f3f0f0;
    border-bottom: 1px solid #f3f0f0;
    margin-bottom: 10px;
    padding: 10px 0px 10px 0px;
    background-color: white;

    .sign-info-head {
      overflow: hidden;
      padding-left: 15px;
      padding-right: 15px;
    }


    .sign-campsu-wrapper {
      float: left;
    }

    .sign-loc-ico {
      background: url(//fin.91mycloud.com/signLocationIco.png)
      no-repeat center center;
      background-size: cover;
      width: 10px;
      height: 16px;
      display: inline-block;
      vertical-align: middle;
    }


    .sign-info-bottom {
      // border-top: 1px solid #f3f0f0;
      padding-top: 10px;
      padding-left: 15px;
    }
    .sign-info-title {
      font-size: 16px;
      color: 444;
    }

    .sign-cont {
      margin-top: 2px;
      margin-right: 10px;
      float: right;
      position: relative;

      .sign-link-ico {
        right: 0;
      }
    }

    .sign-info-body {
      color: #696969;
      padding-top: 8px;
      padding-bottom: 8px;
      padding-left: 15px;
      padding-right: 15px;
      min-height: 80px;
      font-size: 14px;
    }
    .sign-info-body,.sign-info-bottom {

    }

    .bd-item-od {
      padding-bottom: 15px;
      border-bottom: 1px solid #f3f0f0;
    }




    .sign-date {
      float: right;
      color: #cecece;
      font-size: 14px;
    }



    .sign-campus {
      display: inline-block;
      vertical-align: middle;
      font-size: 14px;
      color: #666666;
    }

    .sign-info-bottom  {
      color: #999;
      overflow: hidden;
      font-size: 12px;
      padding:6px 15px 0;
    }

    .sign-info-body, .sign-info-bottom {
      color: #999999;
    }

    .sign-info-body {
      padding-bottom: 4px;
      font-size: 13px;
    }

    .bd-item-body {
      display: table;
      margin: 6px 0 0;
    }

    .bd-it-lf {
      padding-right: 24px;
      border-right: 1px solid #cccccc;
      display: table-cell;
      vertical-align: middle;
    }

    .bd-it-rt {
      padding-left: 26px;
      display: table-cell;
    }
    .sign-usr-lf {
      float: left;
    }
    .sign-usr-rt {
      float: right;
      text-align: center;
    }

    .new-sign-item {
      margin-bottom: 15px;
    }

    .new-new-sign-box {
      padding-bottom: 10px;
    }

    .sign-usr {
      overflow: hidden;
      padding-bottom: 4px 0;
    }

    .sign-info-bottom {
      position: relative;
      font-size: 12px;
    }
  }
</style>
